import React, { useEffect, useState, useRef } from 'react'
import styles from './enquiry.less'
import Step1 from './step1'
import Step2 from './step2'
import Step3 from './step3'

function Index() {
  const ref = useRef()
  const [stepIndex, setStepIndex] = useState(2)
  useEffect(() => {

  }, [])
  function updateIndex() {
    if (stepIndex < 3) {
      setStepIndex(stepIndex + 1)
    }
  }
  return (
    <div className={styles.box}  >
      {
        stepIndex == 1 && <Step1 onNext={updateIndex} />
      }
      {
        stepIndex == 2 && <Step2 onNext={updateIndex} />
      }
       {
        stepIndex == 3 && <Step3 onNext={updateIndex} />
      }
    </div>
  )
}

export default Index
